import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 三石
 * Date: 2022-04-26
 * Time: 20:224
 *
 */
public class Bite {

    /**
     * 求！1+！2+！3+...+！n之和
     * @param j
     * @return
     */
    public static int Fun(int j){
        int ret=1;
        for (int i = 1; i <=j ; i++) {
            ret*=i;
        }
        return ret;
    }
    public static void main7(String[] args) {
        Scanner scanner=new Scanner(System.in);
        System.out.print("请输入数字n=");
        int n=scanner.nextInt();
        int sum=0;
        for (int j = 1; j <=n; j++) {
            sum+=Fun(j);
        }
        System.out.println("阶乘和为："+sum);
    }
    

    public static int Add(int a,int b){
        return a+b;
    }
    public static double Add(double a,double b,double c){
        return a+b+c;
    }
    public static void main7(String[] args) {
        Scanner scanner=new Scanner(System.in);
        System.out.print("a=");
        int a=scanner.nextInt();
        System.out.print("b=");
        int b=scanner.nextInt();
        System.out.print("c=");
        double c=scanner.nextDouble();
        System.out.print("d=");
        double d= scanner.nextDouble();
        System.out.print("e=");
        double e= scanner.nextDouble();

        int m=Add(a,b);
        double n=Add(d,e,c);
        System.out.println(m);
        System.out.println(n);
    }

    /**
     * 打印一个二进制数的偶数位和奇数位
     * @param args
     */
    public static void main6(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();

        for (int i = 31; i >=1 ; i-=2) {   //偶数位
            int a=(n>>i)&1;
            System.out.print(a+" ");
        }
        System.out.println();
        for (int i = 30; i >=0 ; i-=2) {  //奇数位
            int b=(n>>i)&1;
            System.out.print(b+" ");
        }
    }


    /**
     * 判断一个数是不是素数
     * @param args
     */
    public static void main5(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n= scanner.nextInt();
        int i = 2;
        for (; i <=Math.sqrt(n); i++) {
            if(n%i==0){
                System.out.println(n+"不是素数！");
                break;
            }
        }
        if(i>Math.sqrt(n)){
            System.out.println(n+"是素数！");
        }
    }


    /**
     * 求两个数的最小公倍数
     * @param args
     */
    public static void main4(String[] args) {
        Scanner scanner=new Scanner(System.in);
        System.out.println("请输入第一个数n:");
        int n= scanner.nextInt();
        System.out.println("请输入第二个数m：");
        int m= scanner.nextInt();
        int a=n,b=m;

        int c=n%m;
        while (c!=0){
            n=m;
            m=c;
            c=n%m;
        }
        int x=a*b/m;
        System.out.println("n和m的最小公倍数为：");
        System.out.println(x);
    }


    /**
     * 求两个数的最小公因数（辗转相除法）
     */
    public static void main3(String[] args) {
        Scanner scanner=new Scanner(System.in);
        System.out.println("请输入第一个数n:");
        int n= scanner.nextInt();
        System.out.println("请输入第二个数m：");
        int m= scanner.nextInt();

        int c=n%m;
        while (c!=0){
            n=m;
            m=c;
            c=n%m;
        }
        System.out.println("n和m的最大公因数为：");
        System.out.println(m);
    }


    /**
     * 求一个数中1的个数
     */
    public static void main2(String[] args) {
        Scanner scanner=new Scanner(System.in);
        System.out.println("请输入数字：");
        int m= scanner.nextInt();
        int n=m;
        int count=0;
        while (n!=0){  //如0000 0111 只需要移3次
            if((n&1)==1){
                count++;
            }
            n>>>=1;    //无符号右移，否则输入-1时会出现死循环
        }
        System.out.println(m+"中1的个数为："+count);
    }

    /**
     * 判断一个数是不是2的次方
     * @param args
     */
    public static void main1(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n= scanner.nextInt();
        int m=n&(n-1);
        if(m==0){
            System.out.println(n+"是2的次方");
        }
    }
}
